#include<iostream>
using namespace std;
class Date
{
public:
	Date(int year, int month, int day) :
		_year(year),
		_month(month),
		_day(day)
	{}
	Date(const Date& d)
	{
		_year = d._year;
		_month = d._month;
		_day = d._day;
	}
	int  MonthDay()
	{
		int M[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (_day == 2)
		{
			if (JugeLeapYear(this->_year))
			{
				return M[2] + 1;
			}
			else
			{
				return M[2];
			}
		}
		else
		{
			return M[_month];
		}
	}
	bool JugeLeapYear(int year)
	{
		if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	void print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}
	int  JudgeDay(Date&d)
	{
		int n = 0;
		int sumday = 0;
		int sum1 = 0;
		int sum2 = 0;
		n = _year - d._year;
		for (int i = _year; i < n; i++)
		{
			if (JugeLeapYear(i))
			{
				sumday += 366;
			}
			else
			{
				sumday += 365;
			}
		}
		for (int i = 1; i <_month; i++)
		{
			sum1 += this->MonthDay();
		}
		sum1 += _day;
		for (int i = 1; i <d._month; i++)
		{
			sum2 += d.MonthDay();
		}
		sum2 += d._day;
		if (sum1 > sum2)
		{
			sumday = sumday +(sum1 - sum2);
		}
		else 
		{
			sumday = sumday + (sum2 - sum1);
		}
		return sumday;
	}
private:
	int _year;
	int _month;
	int _day;
};
int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	Date d1(a, b, c);
	cin >> a >> b >> c;
	Date d2(a, b, c);
	int ret=d1.JudgeDay(d2);
	cout << ret << endl;

}
